package com.itany.nmms.controller;

import com.github.pagehelper.PageInfo;
import com.itany.nmms.entity.ProductType;
import com.itany.nmms.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @date 2025/9/29
 */
@Controller
@RequestMapping("/type")
public class ProductTypeController {

    @Autowired
    private ProductTypeService typeService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(String pageMo,String pageSize){
        ModelAndView mav = new ModelAndView();
        PageInfo<ProductType> typePage = typeService.findPage(pageMo, pageSize);
        mav.addObject("typePage",typePage);
        mav.setViewName("backend/productTypeManager");
        return mav;
    }
}
